package cn.kxhp.mybatis3.service;


import cn.kxhp.mybatis3.dao.mapper.ext.UserExtMapper;
import cn.kxhp.mybatis3.entity.User;
import cn.kxhp.mybatis3.pojo.UserRoleDTO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Lianxw
 * @since 2022/3/24
 */
@Service
public class UserService {

    private final UserExtMapper userExtMapper;

    public UserService(UserExtMapper userExtMapper) {
        this.userExtMapper = userExtMapper;
    }

    public List<UserRoleDTO> queryAllUserAndRoles() {
        User condition = new User();
        condition.setUsername("admin");
        return userExtMapper.selectUserWithRole(condition);
    }
}
